﻿@model ElingOA6_Admin_DSJCJ.Areas.Admin.Models.DocumentPubEditViewModel
@helper comboxFQBMDept(string pronoun, string authorityType)
    {
        var tmpList = Model.documentAuthorityList.Where(s => s.FPronoun == pronoun).ToList();
        ComboBoxSettings comboSetting = new ComboBoxSettings();
        comboSetting.Name = "cbo_" + authorityType + "_" + pronoun;
        comboSetting.Width = 100;
        comboSetting.Properties.TextField = "Text";
        comboSetting.Properties.ValueField = "Value";
        comboSetting.Properties.DropDownStyle = DropDownStyle.DropDownList;
        comboSetting.Properties.EnableAnimation = false;
        if (tmpList.Count() > 0)
        {
    @Html.DevExpress().ComboBox(comboSetting).BindList(ViewData["clsAuthorityPropSelection"]).Bind(tmpList[0].FProp).GetHtml()
        }
        else
        {
    @Html.DevExpress().ComboBox(comboSetting).BindList(ViewData["clsAuthorityPropSelection"]).Bind(
                                        (ViewData["clsAuthorityPropSelection"] as List<SelectListItem>)[0].Value
    ).GetHtml()
        
        }
}
<table class="tableForm">
    <tr>
        <td>
            @Html.DevExpress().CheckBox(
                    settings =>
                    {
                        settings.Name = "chkLookRHR";
                        settings.Checked = Model.documentAuthorityList.Exists(s => s.FPronoun == "EVERYONE") ? true : false;
                        settings.Text = "任何人可查看";
                        settings.Properties.ClientSideEvents.Init = "function(s,e){chkRHR_ValueChanged('Look')}";
                        settings.Properties.ClientSideEvents.ValueChanged = "function(s,e){chkRHR_ValueChanged('Look')}";
                    }).GetHtml()
        </td>
    </tr>
</table>
<table class="tableForm" id="tableQJLook" style="display:none">
    <tr>
        <td>
            @Html.DevExpress().CheckBox(
                    settings =>
                    {
                        settings.Name = "chkLookQJ";
                        settings.Checked = Model.documentAuthorityList.Exists(s => s.FPronoun == "ALL") ? true : false;
                        settings.Text = "全局";
                        settings.Properties.ClientSideEvents.Init = "function(s,e){chkQJ_ValueChanged('Look')}";
                        settings.Properties.ClientSideEvents.ValueChanged = "function(s,e){chkQJ_ValueChanged('Look')}";
                    }).GetHtml()
        </td>
    </tr>
</table>
<table class="tableForm" id="tableLook" style="display:none">
    <tr>
        <td style="width: 15%">
            @Html.DevExpress().CheckBox(
                    settings =>
                    {
                        settings.Name = "chkLookFQBM";
                        settings.Checked = Model.documentAuthorityList.Exists(s => s.FPronoun == "DEPT0" ) ? true : false;
                        settings.Text = "发起部门";
                        settings.Properties.ClientSideEvents.Init = "function(s,e){chkFQBM_ValueChanged('chkLookFQBM','cbo_LOOK_DEPT0')}";
                        settings.Properties.ClientSideEvents.ValueChanged = "function(s,e){chkFQBM_ValueChanged('chkLookFQBM','cbo_LOOK_DEPT0')}";
                    }).GetHtml()
        </td>
        <td style="width: 85%" class="tdClass">
            @comboxFQBMDept("DEPT0", "LOOK")</td>
    </tr>
    <tr>
        <td style="width: 15%">
            @Html.DevExpress().CheckBox(
                    settings =>
                    {
                        settings.Name = "chkLookFQBM_DEPT1";
                        settings.Checked = Model.documentAuthorityList.Exists(s => s.FPronoun == "DEPT1") ? true : false;
                        settings.Text = "发起部门上级";
                        settings.Properties.ClientSideEvents.Init = "function(s,e){chkFQBM_ValueChanged('chkLookFQBM_DEPT1','cbo_LOOK_DEPT1')}";
                        settings.Properties.ClientSideEvents.ValueChanged = "function(s,e){chkFQBM_ValueChanged('chkLookFQBM_DEPT1','cbo_LOOK_DEPT1')}";
                    }).GetHtml()
        </td>
        <td style="width: 85%" class="tdClass">
            @comboxFQBMDept("DEPT1", "LOOK")</td>
    </tr>
    <tr>
        <td style="width: 15%">
            @Html.DevExpress().CheckBox(
                    settings =>
                    {
                        settings.Name = "chkLookFQBM_DEPT2";
                        settings.Checked = Model.documentAuthorityList.Exists(s => s.FPronoun == "DEPT2") ? true : false;
                        settings.Text = "发起部门上2级";
                        settings.Properties.ClientSideEvents.Init = "function(s,e){chkFQBM_ValueChanged('chkLookFQBM_DEPT2','cbo_LOOK_DEPT2')}";
                        settings.Properties.ClientSideEvents.ValueChanged = "function(s,e){chkFQBM_ValueChanged('chkLookFQBM_DEPT2','cbo_LOOK_DEPT2')}";
                    }).GetHtml()
        </td>
        <td style="width: 85%" class="tdClass">
            @comboxFQBMDept("DEPT2", "LOOK")</td>
    </tr>
    <tr style="display:none;">
        <td style="width: 15%">
            @Html.DevExpress().CheckBox(
                    settings =>
                    {
                        settings.Name = "chkLookFQBM_DEPT3";
                        settings.Checked = Model.documentAuthorityList.Exists(s => s.FPronoun == "DEPT3") ? true : false;
                        settings.Text = "发起部门上3级";
                        settings.Properties.ClientSideEvents.Init = "function(s,e){chkFQBM_ValueChanged('chkLookFQBM_DEPT3','cbo_LOOK_DEPT3')}";
                        settings.Properties.ClientSideEvents.ValueChanged = "function(s,e){chkFQBM_ValueChanged('chkLookFQBM_DEPT3','cbo_LOOK_DEPT3')}";
                    }).GetHtml()
        </td>
        <td style="width: 85%" class="tdClass">
            @comboxFQBMDept("DEPT3", "LOOK")</td>
    </tr>
    <tr style="display:none;">
        <td style="width: 15%">
            @Html.DevExpress().CheckBox(
                    settings =>
                    {
                        settings.Name = "chkLookFQBM_DEPT4";
                        settings.Checked = Model.documentAuthorityList.Exists(s => s.FPronoun == "DEPT4") ? true : false;
                        settings.Text = "发起部门上4级";
                        settings.Properties.ClientSideEvents.Init = "function(s,e){chkFQBM_ValueChanged('chkLookFQBM_DEPT4','cbo_LOOK_DEPT4')}";
                        settings.Properties.ClientSideEvents.ValueChanged = "function(s,e){chkFQBM_ValueChanged('chkLookFQBM_DEPT4','cbo_LOOK_DEPT4')}";
                    }).GetHtml()
        </td>
        <td style="width: 85%" class="tdClass">
            @comboxFQBMDept("DEPT4", "LOOK")</td>
    </tr>
    <tr style="display:none;">
        <td style="width: 15%">
            @Html.DevExpress().CheckBox(
                    settings =>
                    {
                        settings.Name = "chkLookFQBM_DEPT5";
                        settings.Checked = Model.documentAuthorityList.Exists(s => s.FPronoun == "DEPT5") ? true : false;
                        settings.Text = "发起部门上5级";
                        settings.Properties.ClientSideEvents.Init = "function(s,e){chkFQBM_ValueChanged('chkLookFQBM_DEPT5','cbo_LOOK_DEPT5')}";
                        settings.Properties.ClientSideEvents.ValueChanged = "function(s,e){chkFQBM_ValueChanged('chkLookFQBM_DEPT5','cbo_LOOK_DEPT5')}";
                    }).GetHtml()
        </td>
        <td style="width: 85%" class="tdClass">
            @comboxFQBMDept("DEPT5", "LOOK")</td>
    </tr>
    <tr style="display:none;">
        <td style="width: 15%">
            @Html.DevExpress().CheckBox(
                    settings =>
                    {
                        settings.Name = "chkLookFQBM_DEPT6";
                        settings.Checked = Model.documentAuthorityList.Exists(s => s.FPronoun == "DEPT6" ) ? true : false;
                        settings.Text = "发起部门上6级";
                        settings.Properties.ClientSideEvents.Init = "function(s,e){chkFQBM_ValueChanged('chkLookFQBM_DEPT6','cbo_LOOK_DEPT6')}";
                        settings.Properties.ClientSideEvents.ValueChanged = "function(s,e){chkFQBM_ValueChanged('chkLookFQBM_DEPT6','cbo_LOOK_DEPT6')}";
                    }).GetHtml()
        </td>
        <td style="width: 85%" class="tdClass">
            @comboxFQBMDept("DEPT6", "LOOK")</td>
    </tr>
    <tr>
        <td colspan="2">
            @Html.DevExpress().CheckBox(
                    settings =>
                    {
                        settings.Name = "chkLookCharge";
                        settings.Checked = Model.documentAuthorityList.Exists(s => s.FPronoun == "CHARGE") ? true : false;
                        settings.Text = "分管领导";
                    }).GetHtml()
        </td>
    </tr>
    <tr>
        <td class="tdClass" colspan="2">
            @Html.DevExpress().CheckBox(
                    settings =>
                    {
                        settings.Name = "chkLookBM";
                        settings.Checked = Model.documentAuthorityList.Exists(s => s.FPronoun == "ASSIGNDEPT" ) ? true : false;
                        settings.Text = "指定部门";
                        settings.Properties.ClientSideEvents.Init = "function(s,e){chkBM_ValueChanged('Look')}";
                        settings.Properties.ClientSideEvents.ValueChanged = "function(s,e){chkBM_ValueChanged('Look')}";
                    }).GetHtml()
        </td>
    </tr>
    <tr>
        <td colspan="2">
            <table width="70%" id="tableLookBM" style="display:none"  align="center" cellpadding="0" cellspacing="0" bordercolordark="white" bordercolorlight="#BEBEBE">
                <tr>
                    <th width="20%" style="text-align: center">
                        <img src="@Url.Content("~/Content/images/add.gif")" style="cursor:pointer"  onclick="addRowBm('Look');"/>&nbsp;操作</th>
                    <th width="50%" style="text-align: center">
                        部门</th>
                    <th width="30%" style="text-align: center">
                        级别</th>
                </tr>
            </table>
        </td>
    </tr>
    <tr>
        <td class="tdClass" colspan="2">
            @Html.DevExpress().CheckBox(
                    settings =>
                    {
                        settings.Name = "chkLookGZZ";
                        settings.Checked = Model.documentAuthorityList.Exists(s => s.FPronoun == "GROUP") ? true : false;
                        settings.Text = "指定工作组";
                        settings.Properties.ClientSideEvents.Init = "function(s,e){chkGZZ_ValueChanged('Look')}";
                        settings.Properties.ClientSideEvents.ValueChanged = "function(s,e){chkGZZ_ValueChanged('Look')}";
                    }).GetHtml()
        </td>
    </tr>
    <tr>
        <td colspan="2">
            <table width="70%" id="tableLookGZZ" style="display:none" align="center" cellpadding="0" cellspacing="0" bordercolordark="white" bordercolorlight="#BEBEBE">
                <tr>
                    <th width="20%" style="text-align: center">
                        <img src="@Url.Content("~/Content/images/add.gif")" style="cursor:pointer"  onclick="addRowGZZ('Look');"/>&nbsp;操作</th>
                    <th width="50%" style="text-align: center">
                        工作组</th>
                    <th width="30%" style="text-align: center">
                        级别</th>
                </tr>
            </table>
        </td>
    </tr>
    <tr>
        <td class="tdClass" colspan="2">
            @Html.DevExpress().CheckBox(
                    settings =>
                    {
                        settings.Name = "chkLookGW";
                        settings.Checked = Model.documentAuthorityList.Exists(s => s.FPronoun == "POST") ? true : false;
                        settings.Text = "指定岗位";
                        settings.Properties.ClientSideEvents.Init = "function(s,e){chkGW_ValueChanged('Look')}";
                        settings.Properties.ClientSideEvents.ValueChanged = "function(s,e){chkGW_ValueChanged('Look')}";
                    }).GetHtml()
        </td>
    </tr>
    <tr>
        <td colspan="2">
            <table width="70%" id="tableLookGW"  style="display:none" align="center" cellpadding="0" cellspacing="0" bordercolordark="white" bordercolorlight="#BEBEBE">
                <tr>
                    <th width="20%" style="text-align: center">
                        <img src="@Url.Content("~/Content/images/add.gif")" style="cursor:pointer"  onclick="addRowGW('Look');"/>&nbsp;操作</th>
                    <th width="80%" style="text-align: center" colspan="2">
                        岗位</th>
                </tr>
            </table>
        </td>
    </tr>
    <tr>
        <td style="width: 15%">
            @Html.DevExpress().CheckBox(
                    settings =>
                    {
                        settings.Name = "chkLookYHZ";
                        settings.Checked = Model.documentAuthorityList.Exists(s => s.FPronoun == "ROLE") ? true : false;
                        settings.Text = "指定用户组";
                        settings.Properties.ClientSideEvents.Init = "function(s,e){chkYHZ_ValueChanged('Look')}";
                        settings.Properties.ClientSideEvents.ValueChanged = "function(s,e){chkYHZ_ValueChanged('Look')}";
                    }).GetHtml()
        </td>
        <td style="width: 85%" class="tdClass">
            @Html.DevExpress().ButtonEdit(settings =>
       {
           settings.Name = "txtLookYHZ";
           settings.Width = System.Web.UI.WebControls.Unit.Percentage(96);
           settings.Height = System.Web.UI.WebControls.Unit.Percentage(100);
           settings.ReadOnly = true;
           //settings.Text = ViewData["FEmpName"].ToString(); ;
           settings.Properties.Buttons.Add("选择");
           settings.Properties.ClientSideEvents.ButtonClick = "function(s,e){chooseGroup('Look')}";
           //settings.Properties.ClientSideEvents.Validation = "function(s,e){notEmptyValidation(s,e,'对应员工')}";
       }).GetHtml()
        </td>
    </tr>
    <tr>
        <td style="width: 15%">
            @Html.DevExpress().CheckBox(
                    settings =>
                    {
                        settings.Name = "chkLookUser";
                        settings.Checked = Model.documentAuthorityList.Exists(s => s.FPronoun == "PERSON") ? true : false;
                        settings.Text = "指定人";
                        settings.Properties.ClientSideEvents.Init = "function(s,e){chkUser_ValueChanged('Look')}";
                        settings.Properties.ClientSideEvents.ValueChanged = "function(s,e){chkUser_ValueChanged('Look')}";
                    }).GetHtml()
        </td>
        <td style="width: 85%" class="tdClass">
            @Html.DevExpress().ButtonEdit(settings =>
       {
           settings.Name = "txtLookUser";
           settings.Width = System.Web.UI.WebControls.Unit.Percentage(96);
           settings.Height = System.Web.UI.WebControls.Unit.Percentage(100);
           settings.ReadOnly = true;
           //settings.Text = ViewData["FEmpName"].ToString(); ;
           settings.Properties.Buttons.Add("选择");
           settings.Properties.ClientSideEvents.ButtonClick = "function(s,e){chooseUser('Look')}";
           //settings.Properties.ClientSideEvents.Validation = "function(s,e){notEmptyValidation(s,e,'对应员工')}";
       }).GetHtml()
        </td>
    </tr>
</table>
